export function getQuery(name) {
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
  var r = window.location.search.substr(1).match(reg)
  if (r != null) return decodeURIComponent(r[2])
  return null
}
export function checkTel (tel) {
  /* 验证手机号是否正确 */
  if (!tel) {
    return {
      msg: '请填写正确的手机号',
      result: false
    }
  }
  else {
    let reg = /^(1[3|4|5|6|7|8|9])\d{9}$/
    if (!reg.test(tel)) {
      return {
        msg: '请填写正确的手机号',
        result: false
      }
    }
    else {
      return {
        msg: '',
        result: true
      }
    }
  }
}